
Type Camera Extends BaseObject
	Field vport:Viewport
	
rem
bbdoc: Sets the camera's position. 
endrem
	Method SetPosition(x:Float, y:Float, z:Float)
		o_camera_setPosition(Self._ptr, x, y, z)
	End Method
	
rem
bbdoc: Sets the aspect ratio for the frustum viewport. 
about: <p>The ratio between the x and y dimensions of the rectangular area visible through 
the frustum is known as aspect ratio: aspect = width / height .</p>
<p>The default for most fullscreen windows is 1.3333 - this is also assumed by Ogre unless 
you use this method to state otherwise.</p>
endrem
	Method setAspectRatio(ratio:Float)
		o_setAspectRatio(self._ptr, ratio)
	End Method
	
rem
bbdoc: Moves the camera's position by the vector offset provided along it's own axes (relative to orientation). 
endrem
	Method moveRelative(vec3:bVector3)
		o_camera_moveRelative(Self._ptr, vec3.toC())
	End Method
	
rem
bbdoc: Sets the position of the near clipping plane. 
about: <p>The position of the near clipping plane is the distance from the frustums position to the screen on which 
the world is projected. The near plane distance, combined with the field-of-view and the aspect ratio, determines 
the size of the viewport through which the world is viewed (in world co-ordinates). Note that this world viewport 
is different to a screen viewport, which has it's dimensions expressed in pixels. The frustums viewport should have 
the same aspect ratio as the screen viewport it renders into to avoid distortion.</p> 
<p><b>Parameters:</b></p>
<table cellpadding="4" cellspacing="4" border="0">
<tr>
	<td><i>near</i></td><td>The distance to the near clipping plane from the frustum in world coordinates.</td>
</tr>
</table>
endrem
	Method setNearClipDistance(nearClipDistance:Float)
		o_setNearClipDistance(Self._ptr, nearClipDistance)
	End Method
	
rem
bbdoc: Sets the distance to the far clipping plane.
about: <p>The view frustum is a pyramid created from the frustum position and the edges of the viewport. This method sets 
the distance for the far end of that pyramid. Different applications need different values: e.g. a flight sim needs a 
much further far clipping plane than a first-person shooter. An important point here is that the larger the ratio between 
near and far clipping planes, the lower the accuracy of the Z-buffer used to depth-cue pixels. This is because the Z-range 
is limited to the size of the Z buffer (16 or 32-bit) and the max values must be spread over the gap between near and far 
clip planes. As it happens, you can affect the accuracy far more by altering the near distance rather than the far distance, 
but keep this in mind.</p>
<p><b>Parameters:</b></p>
<table cellpadding="4" cellspacing="4" border"0">
<tr>
	<td><i>far</i></td>
	<td>
		The distance to the far clipping plane from the frustum in world coordinates.If you specify 0, this means an infinite 
		view distance which is useful especially when projecting shadows; but be careful not to use a near distance too close. 
	</td>
</tr>
</table>
endrem
	Method setFarClipDistance(farClipDistance:Float)
		o_setFarClipDistance(Self._ptr, farClipDistance)
	End Method
	
rem
bbdoc: Pitches the camera up/down anticlockwise around it's local z axis. 
endrem
	Method pitch(radian:Float)
		o_camera_pitch(Self._ptr, radian)
	End Method
	
rem
bbdoc: Rotates the camera anticlockwise around it's local y axis.
endrem
	Method yaw(radian:Float)
		o_camera_yaw(Self._ptr, radian)
	End Method
	
rem
bbdoc: Rolls the camera anticlockwise, around its local z axis.
endrem
	Method roll(radian:Float)
		o_camera_roll(Self._ptr, radian)
	End Method
	
rem
bbdoc: Retrieves the camera's position. 
endrem
	Method GetPosition:bVector3()
		Local vec3:bVector3 = bVector3.NullVec()
		vec3.fromC(o_camera_getPosition(Self._ptr))
		
		Return vec3
	End Method
	
rem
bbdoc: Get the last viewport which was attached to this camera. 
about: This is not guaranteed to be the only viewport which is using this camera, just the last once which was created referring to it.
endrem
	Method GetViewport:Viewport()
		If Self.vport = Null Then Self.vport = New Viewport
		Self.vport._ptr = o_camera_getViewPort(Self._ptr)
		return self.vport
	End Method
End Type